package com.qfedu.knowledge.controller;

import com.qfedu.knowledge.entity.vo.ResultVO;
import com.qfedu.knowledge.service.IQuestionMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName QuestionMasterController
 * @Author ykx
 * @Date 2024/4/28 11:13
 * @Version 1.0
 */
@RestController
@RequestMapping("/knowledge")
public class QuestionMasterController {

    @Autowired
    private IQuestionMasterService questionMasterService;

    @PostMapping("/master/save")
    public ResultVO master(@RequestBody List<Long> ids) {
        return ResultVO.success();
    }

    @PutMapping("/master/save/{id}")
    public ResultVO master(@PathVariable Long id) {
        return ResultVO.success(questionMasterService.master(id));
    }

    @DeleteMapping("/master/del/{masterId}")
    public ResultVO noMaster(@PathVariable("masterId") Long masterId) {
        return ResultVO.success(questionMasterService.deleteById(masterId));
    }

}
